package cn.cxj.order.controller;

import cn.cxj.basic.util.AjaxResult;
import cn.cxj.basic.util.LoginContext;
import cn.cxj.order.service.IAdoptOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/adoptOrder")
public class AdoptOrderController {

    @Autowired
    private IAdoptOrderService adoptOrderService;

    @PostMapping("/submit")
    public AjaxResult submit(@RequestBody Map<String, String> params, HttpServletRequest request) {
        String submit = adoptOrderService.submit(params, LoginContext.getCurrentLogininfo(request));
        System.out.println(submit);
        return AjaxResult.me().setResultObj(submit);
    }

}
